import React from 'react';
import {connect} from 'dva-react-router-3';
import {Link} from 'dva-react-router-3/router';
import styles from './App.less';

function App({dispatch, user}) {
    return (
        <div>
            <h1>App1113</h1>
            <Link to="/about">Go to /about</Link>
            <h2 className={styles.title}>User</h2>
            {
                user.map(({id, name}) => <div key={id}>- {name}</div>)
            }
        </div>
    );
}

function mapStateToProps(state) {
    return {
        user: state.user
    };
}

export default connect(mapStateToProps)(App);
